var async = require('async')
var request = require('request');

function task1(next) {
    var url = 'oio.irtutyu.wqqwr';
    request(url, function(err, res, body) {
        // 可以处理的 err
        next(null, {
            err: err,
            length: (body && body.length) || -1
        })
    });
}


function task2(arg, next) {
    console.log('task2, arg=', arg);
    next({
        err: 'task2'
    });
}


function task3(arg, next) {
    console.log('task3, arg=', arg);
    next({
        err: 'task3'
    });
}

async.waterfall([task1, task2, task3], function(err, result) {
    console.log(err || result);
});